package top.tresman.cxxcommon.entity.request;

import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

@Data
public class BasePageRequest implements Serializable {
    @Serial
    private static final long serialVersionUID = -4420793127667281197L;

    @NotNull(message = "页码不能为空")
    @Min(value = 1, message = "页码不能小于1")
    private Integer page = 1;

    @NotNull(message = "每页条数不能为空")
    @Min(value = 1, message = "每页条数不能小于1")
    @Max(value = 500, message = "每页条数不能大于500")
    private Integer perPage = 10;
}
